home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / DeathWallFX.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.1 KB  |  44 lines

  1. class classes.fx.DeathWallFX
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var dir;
  7.    var frame;
  8.    var cMax;
  9.    var clip;
  10.    var a;
  11.    var yMov = 0;
  12.    var c = 0;
  13.    var Name = "deathWallFX";
  14.    function DeathWallFX(px, py, pdir, pframe, pid)
  15.    {
  16.       this.x = px;
  17.       this.y = py;
  18.       this.id = pid;
  19.       this.dir = pdir;
  20.       this.frame = pframe;
  21.       this.cMax = _root.randRange(10,30);
  22.       _root.d = _root.d + 1;
  23.       this.clip = _root.attachMovie("deathWallFX","deathWallFX" + this.id + "Clip",_root.d);
  24.       this.clip._x = this.x;
  25.       this.clip._y = this.y;
  26.       this.a = _root.randRange(30,60);
  27.       this.clip._alpha = this.a;
  28.       this.clip.gotoAndStop(this.frame);
  29.       this.yMov = this.dir != "U" ? _root.randRange(20,40) : _root.randRange(-20,-40);
  30.    }
  31.    function main()
  32.    {
  33.       this.c = this.c + 1;
  34.       if(this.c >= this.cMax)
  35.       {
  36.          _root.removeFX("deathWallFX" + this.id);
  37.       }
  38.       this.clip._alpha = this.a - this.c * (this.a / this.cMax);
  39.       this.y += this.yMov;
  40.       this.clip._x = this.x;
  41.       this.clip._y = this.y;
  42.    }
  43. }
  44.